{$CLEO .cs}
{$use cleo+}
0000:

model.Load(#ARMY) 
model.Load(#m4) 
038B: load_requested_models


const

Found_target =   19@
Random_victims = 10@
end
Found_target = false 
while $onmission >= 1   
wait 0      
    if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2661.4329 878.1954 79.7738 radius 100.0 100.0 100.0
    then
 
            if not marker_enabled 1@
            then
               1@ = marker.CreateIconWithoutSphere(37,  -2661.4329, 878.1954, 79.7738)
            end
            if   and
              02A0:   actor $PLAYER_ACTOR stopped
              00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere  -2661.4329 878.1954 79.7738 radius 4.0 4.0 4.0
            then
                 goto @Target
            end

             wait 100   
          
    else 
            if  marker_enabled 1@
            then
                marker.Disable(1@ )
            end        
            if  marker_enabled 2@
            then
                marker.Disable(2@ )
            end        
        wait 100
    end 
    
 
end 

:Target
show_styled_text "~w~Look for the target" 4000 5
  add_text_label "@hitman" "Army soldier is a fake army soldier, go over there and kill least a civilian around the hood. I'll come for you!"
0512: show_permanent_text_box '@hitman'  // If your health reaches zero, you will pass out and you will be treated at the local medical center.

while $onmission >= 1 
wait 0
0208: 13@ = random_float_in_ranges 200.0 350.0
0208: 14@ = random_float_in_ranges 200.0 350.0

04C4: store_coords_to 20@ 21@ 22@ from_actor $PLAYER_ACTOR with_offset 13@ 14@ 0.0
02C0: store_to  23@ 24@ 25@ ped_path_coords_closest_to  20@ 21@ 22@
if Found_target == false 
then
0AE1: Random_victims = random_char_near_point  -2661.4329 878.1954 79.7738 in_radius 99999999.0 find_next -1 pass_deads 0
end
if  and
Found_target == false 
is_actor_defined  Random_victims
then
    089F: get_actor Random_victims pedtype_to 4@
    if or
    4@ == 4
    4@ == 5
    then
        if actor.Dead( Random_victims )
        then
           Found_target = true 
        end    
    end

end  
      if  and 
      not is_actor_defined  0@
      Found_target == true  
      then
          0@ = actor.Create(gang6, #ARMY , 23@, 24@, 25@ )
          actor.Health(0@)= 3000
          actor.GiveWeaponAndAmmo(0@, m4 ,88888)
          actor.WeaponAccuracy(0@)=90
          0446: set_actor 0@ dismemberment_possible 0
          07DD: set_actor 0@ attack_rate 100 // previously known as temper_to 
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor 0@ fighting_style_to 7 moves 6
          05DE: AS_actor 0@ walk_around_ped_path
          081A: set_actor 0@ weapon_skill_to 2
          05E2: AS_actor 0@ kill_actor player1
         0946: set_actor 0@ actions_uninterupted_by_weapon_fire 1

          marker.CreateAboveActor(2@,0@)
          show_styled_text "~r~Target location revealed!~N~~r~Kill the target!" 4000 5
          03E6: remove_text_box

      end
      if is_actor_defined   0@
      then
          if actor.Dead(0@)
          then
              show_styled_text "~y~Target eliminated!~n~~b~Reward~n~~w~$2500" 4000 5
              0109: player $PLAYER_CHAR money += 2500
              018C: play_sound 1052 at 0.0 0.0 0.0
              $HITMAN_DESTROYED += 1 
              $HITMAN_DESTROYED_SF += 1 
              break
          end
      
      end 
end
03E6: remove_text_box

//Cleanup 
if is_actor_defined  0@
then
    actor.RemoveReferences( 0@ )
end 
if  marker_enabled 1@
then
marker.Disable(1@ )
end        
if  marker_enabled 2@
then
marker.Disable(2@ )
end             
model.destroy(#ARMY) 
model.destroy(#m4) 

terminate_this_custom_script